//
//  Fraction.h
//  02-分数作业(老师版)
//
//  Created by LL.F on 16/7/7.
//  Copyright © 2016年 LL.F. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Fraction : NSObject
//*************属性**************
@property (nonatomic , assign) NSInteger member;//分子
@property (nonatomic , assign) NSInteger denominator;//分母

//*********自定义初始化方法**********
- (id)initWithMember:(NSInteger)member
          denminator:(NSInteger)denminator;

//**********便利构造器方法*************
+ (id)fractionWithMember:(NSInteger)member
              denminator:(NSInteger)denminator;

//**********分数相关的功能***************
//  两个分数相加
- (Fraction *)addFraction:(Fraction *)anotherFraction;
//  两个分数相减
- (Fraction *)subFraction:(Fraction *)anotherFraction;
//  两个分数相乘
- (Fraction *)mulFraction:(Fraction *)anotherFraction;
//  两个分数相除
- (Fraction *)divFraction:(Fraction *)anotherFraction;
//  约分
- (void)reduce;
//  输出
- (void)output;
//  比较大小
- (NSComparisonResult)compare:(Fraction *)anotherfraction;

- (NSString *)description;
@end
